package org.cloud.demo1.controller;

import org.cloud.demo1.entity.UserOfDemo1;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试demo1
 * @author wangyuan
 * @since 2019年6月2日 下午8:59:54
 *
 */
@RestController
@RequestMapping(value = "/demo1")
public class Demo1Controller {

	@RequestMapping(value = "/testMethod1", method = RequestMethod.GET)
	public String testMethod1OfDemo1() {
		throw new NullPointerException("故意抛的一个异常信息");
		//return "你成功的调用了Demo1的服务";
	}
	
	@RequestMapping(value = "/testMethod2", method = RequestMethod.GET)
	public UserOfDemo1 testMethod2OfDemo1() {
		return new UserOfDemo1(1, 11, "111");
	}
}
